package com.overto.gwt.hermes.client;

/**
 * Exception thrown when JSON HTTP request fails.
 */
public class JSONHttpException extends Throwable {	
	private static final long serialVersionUID = 3321444358361205204L;
	private int httpStatusCode; 
	private String httpStatusText;
	private String text;

	public JSONHttpException() {
	}

	public JSONHttpException(String message) {
		super(message);
	}

	public JSONHttpException(Throwable innerException) {
		super(innerException);
	}

	public JSONHttpException(String message, Throwable innerException) {
		super(message, innerException);
	}

	public JSONHttpException(int httpStatusCode, String httpStatusText, 
			String text) {
		super("HTTP error: " + httpStatusCode + "\nStatus text:" +
				httpStatusText + "\nText:" + text);
		this.httpStatusCode = httpStatusCode;
		this.httpStatusText = httpStatusText;
		this.text = text;
	}

	public int getHttpStatusCode() {
		return httpStatusCode;
	}

	public String getHttpStatusText() {
		return httpStatusText;
	}

	public String getText() {
		return text;
	}
	
	
	
}
